package cn.edu.just.firstjavaapp.l14.exception;

import java.util.Date;

public class Main {
    public static void main(String[] args) {
        f1();
    }

    private static void f1() {
        f2();
    }

    private static void f2() {
        f3();
    }

    private static void f3() {
        try {
            System.out.println("enter into f3");
            int a = 10 / 3;
            Date now = null;
            System.out.println(now.getMonth()+1);
            System.out.println("code in f3");
            System.out.println("exit from f3");
        }catch (ArithmeticException e){
            System.out.println("除数是0，请注意验证除数");
        }catch (NullPointerException e){
            System.out.println("发生了空指针异常");
        }finally {
            System.out.println("这里总是会执行");
        }
    }
}
